package bbGraphs;

import java.util.Comparator;

public class Pair<L,R> 
{

  private final L left;
  private final R right;

  public Pair( L _left, R _right) 
  {
    this.left = _left;
    this.right = _right;
  }

  public L getLeft() { return left; }
  public R getRight() { return right; }

  @Override
  public int hashCode() { return left.hashCode() ^ right.hashCode(); }

  @Override
  public boolean equals( Object _obj ) 
  {
    if( _obj == null ) 
    	return false;
    
    if( ! ( _obj instanceof Pair ) ) 
    	return false;
    Pair pairo = ( Pair ) _obj;
    
    return this.left.equals( pairo.getLeft() ) &&
           this.right.equals( pairo.getRight() );
  }

}

